package main

import (
	"encoding/json"
	"fmt"
)

func main() {
	person := &Person{"张三", 30, "男"}
	bytes, _ := json.Marshal(person)
	fmt.Println("json is:", string(bytes))

	var p Person
	json.Unmarshal(bytes, &p)
	fmt.Println(p)
}

type Person struct {
	Name string `json:"name"`
	Age int32	`json:"age"`
	Gender string	`json:"gender"`
}
